<?php
namespace app\admin\controller;
use think\Db;
use think\Session;
use think\Request;
class Log  extends Common
{
        public function index(){
            return $this->view->fetch();
        }
        public function log(){
        	//数量
	        $leaveCount = Db::name("log")->count();

	        //分页数据
	        $limit=input('limit');
	        $page=input('page');
	        $start=($page-1)*$limit;

	        //调取数据
	        $orderall=Db::name("log")->limit($start,$limit)->order('id desc')->select();

	        //API数据格式处理
	        $data= array();
	        $data['code']=0;
	        $data['msg']='';
	        $data['count']=$leaveCount;
	        $data['data']=$orderall;

	        //返回json数据
	        echo $data=json_encode($data);
        }
}